﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace Lis.IRepository
{
    public interface IGenericRepository<T> where T:class,new ()
    {
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="t">实体对象</param>
        /// <returns></returns>
        bool Add(T t); 

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="t">实体对象</param>
        /// <returns></returns>
         bool Delete(T t);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
         bool Update(T t);

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <typeparam name="S"></typeparam>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="total"></param>
        /// <param name="isAsc"></param>
        /// <param name="whereLambda"></param>
        /// <param name="orderByLambda"></param>
        /// <returns></returns>
         IQueryable<T> GetPageEntities<S>(int pageSize, int pageIndex, out int total, bool isAsc, Expression<Func<T, bool>> whereLambda, Expression<Func<T, S>> orderByLambda);
    }
}
